package com.chy.sprbootmanual.controller;

import com.chy.sprbootmanual.service.GalleryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import static com.chy.sprbootmanual.jdbcutil.Constant.REDIRECT;

@Controller
@Slf4j
public class GalleryController {

    @Autowired
    private GalleryService galleryService;

    @RequestMapping(value = "/gallerydel",method = RequestMethod.GET)
    public String galleryDel(String name){
        log.warn("========执行删除操作=======");
        log.warn(name);
        galleryService.delete(name);
        return REDIRECT;
    }
}
